 /**
  * Copyright (c) 2017-2019 tencent, All rights reseved.
  * @fileoverview flex
  * @author carllsun | carllsun@tencent.com
  * @version 1.0  | 2017-12-07 | carllsun    // 初始版本。
  *
  * ### Progress【props】
  * | 属性 | 描述 |
  * | --- | --- |
  * | percent | [必填] 进度百分比 |
  * | stroke-width | [可选] 进度条线的宽度，单位 rpx，默认值 16 |
  * | active-color | [可选] 高亮态进度条的颜色，支持纯色与线性渐变色。默认值 "#ffca49, #ffb262"。若只填一个色值，则进度条显示为该纯色值。 |
  * | background-color | [可选] 进度条背景色，默认值 "#e5e5e5" |
  * | radius | [可选] 圆角角度，单位 rpx, 默认值 15|
 */
Component({
  behaviors: [],
  properties: {
    percent: {
      type: [Number, String],
      value: 100
    },
    strokeWidth: {
      type: [Number, String],
      value: 16
    },
    activeLineColor: {
      type: Array,
      value: []
    },
    activeColor: {
      type: [String, Array],
      value: '#ffca49, #ffb262'
    },
    backgroundColor: {
      type: String,
      value: '#e5e5e5'
    },
    radius: {
      type: [Number, String],
      value: 15
    }
  },
  data: {},
  methods: {},
  attached: function () {
    let activeColor = this.data.activeColor;
    
    if (!!~activeColor.indexOf(',')) {
      this.setData({
        activeLineColor: activeColor.split(',')
      })
    }
  }
});
